$(function(){
	        //获取行政区数据
	        $.ajax({
	            url:'./tree/tree',
	            dataType: 'json'
	        }).done(function(data){
	                    if(!data){
	                        return;
	                    }

	                    //初始化行政区树
	                    var settings={
	                    		treeId:"mytree",
	                    		check:{enable:true},
	                    		view:{showIcon:false,
	                    			fontCss:{font_size:"15px"}
                                      },
	                    		callback: {
	                    			onClick: myOnClick,
	                    			onCheck: myOnCheck
	                    		}
	                    };
	                    
	                    var treeObj = $.fn.zTree.init($('#xzqtree'),settings, data);
	                  //  var nodes = treeObj.getNodesByParam("name", "root", null);
	                  //var treeId=treeObj.
	                  var nodes = treeObj.getNodes();
	                  if (nodes.length>0) {
	                		treeObj.expandNode(nodes[0], true, false, true);
	                	}
	                  var nodes2 = treeObj.getNodesByParam("parentId", "-1", null);
	                   
	                   if (nodes2.length==2) {
	                		treeObj.expandNode(nodes2[0], true, false, true);
	                		treeObj.expandNode(nodes2[1], true, false, true);
	                	}
	                   var nodes2 = treeObj.getNodesByParam("name", "谭坪外围", null);
	                   if (nodes2.length==1) {
	               		   treeObj.expandNode(nodes2[0], true, false, true);   		
	                 	}
	                   
	                   //节点点击的处理
	                   function myOnClick(event, treeId, treeNode) {               	                 	   
	                	    alert(treeNode.tId + ", " + treeNode.name);
	                	};
	                	//节点checked的处理
	                	function myOnCheck(event, treeId, treeNode) {
	                	    alert(treeNode.tId + ", " + treeNode.name + "," + treeNode.checked);
	                	};
	                   
	                });
	    });
	    
	    $(function(){
	    	var treeObj = $.fn.zTree.getZtreeObj();
	    });
